<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>

    <title>欢迎使用</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!--<link rel="shortcut icon" th:href="@{/favicon.ico}" type="image/ico" />-->
</head>
<body>
<h1>themeleaf Hello World</h1>
<h1>字符串对象显示</h1>
<b th:text="${username}">姓名</b>
<h2 th:text="${username}"></h2>
<h1>对象显示</h1>
<div th:object="${user}">
    <p th:text="*{username}"></p>
    <p th:text="*{password}"></p>
    <p th:text="*{age}"></p>
    <p th:text="*{price}"></p>
    <p th:text="*{birth.getTime()}"></p>
    <p th:text="*{#dates.format(birth,'yyyy-MM-dd')}"></p>
</div>
<h3 th:text="${user.username}"></h3>
<h3 th:text="${user.password}"></h3>

<h1>集合遍历</h1>
<table>
<tr>
    <th>序号</th>
    <th>用户名</th>
    <th>密码</th>
    <th>年龄</th>
    <th>价格</th>
    <th>生日</th>
</tr>

    <tr th:each="u ,uState:${ul}">
        <td th:text="${uState.index}"></td>
        <td th:text="${u.username}"></td>
        <td th:text="${u.password}"></td>
        <td th:text="${u.age}"></td>
        <td th:text="${u.price}"></td>
        <td th:text="${#dates.format(u.birth,'yyyy-MM-dd')}"></td>
    </tr>



</table>

<h1>文件加载</h1>

<img src="/images/timg.jpg" />

<h1>表单</h1>
<a th:href="addform">添加</a>

</body>
</html>